import 'package:flutter/widgets.dart';

import '../../logger.dart';
import '../lifecycle.dart';

class StoreWithLifecycle implements ILifecycle {
  BuildContext context;

  @override
  @mustCallSuper
  onContextAttached(BuildContext context) {
    this.context = context;
    Logger.d(msg: '$this-$context...onContextAttached');
  }

  @override
  @mustCallSuper
  onContextDetached(BuildContext context) {
    Logger.d(msg: '$this-$context...onContextDetached');
    this.context = null;
  }

  @override
  @mustCallSuper
  onCreate() {
    Logger.d(msg: '$this...onCreate');
  }

  @override
  @mustCallSuper
  onDefunct() {
    Logger.d(msg: '$this...onDefunct');
  }
}